<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller 
{
    function Welcome() 
    {
        parent::__construct();
        $this->load->helper('html');
        $this->load->helper('url');
        $this->load->helper('form');
    }
    
    public function index()
    {	
        $data['message'] = "";

        //Database
        $data['make'] = $this->db->get('psacar_make');
        //$data['model'] = $this->db->get('psacar_model');
        
        $this->db->where('type_id', 3);
        $this->db->order_by('company', 'asc');
        $data['dealer']= $this->db->get('psacar_member');

        $this->db->order_by("order", "asc"); 
        $this->db->order_by("province", "asc"); 
        $data['location'] = $this->db->get('psacar_location');
        
        $data['category'] = $this->db->get('psacar_category');		        
		
        $this->load->model('Car_model');
        $data['review_list'] = $this->Car_model->get_car_list();
        
        //$data['review_list'] = $this->db->get_where('psacar_news', array('news_cat_id' => 2));
        
        $this->load->view('header', $data);
        $this->load->view('index', $data);
        $this->load->view('footer', $data);
    }
}